package com.pz.cloud.framework.business.workflow.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pz.cloud.framework.base.model.WorkflowEntity;
import com.pz.cloud.framework.business.workflow.entity.TaskNodeAttr;
import com.pz.cloud.framework.business.workflow.model.*;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.TreeNode;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;

public interface IWorkflowService {
    /**
     * 流程提交
     * @param
     * @return
     */
    Result submit(WorkflowModel workflowModel);

    /**
     * 流程部署
     * @return
     */
    Result deployProcess(InputStream inputStream);

    /**
     * 判断流程是否结束
     * @param instanceId
     * @return
     */
    boolean isProcessEnd(String instanceId);


    void deleteProcessInstance(String instanceId);

//    void assembleTaskData(WorkflowEntity workflowEntity);

    TaskApproveModel queryFlowNodeData(String taskId);

    List<TreeNode> selectDealUser(String taskKey);

    void showProcessImageByBizId(String bizId, OutputStream outputStream) throws IOException;

    void showProcessImageByProcessDefineKey(String processDefineKey, OutputStream outputStream) throws IOException;

    void assembleDealFlag(WorkflowEntity workflowEntity);

    Integer getDealFlagByBizId(String bizId);

    List<ProcessBean> definitionList(ProcessBean processBean);

    IPage<ProcessBean> definitionPage(ProcessBean processBean);

    List<TaskNodeModel> taskNodeList(String processDefinitionId);

    void batchSubmitTask(List<String> bizId, Integer dealResult);

    void deleteProcessByBizId(String bizId,Boolean deleteWaitDone);

    void revoke(String taskId);

    public TaskNodeModel getFirstTaskByBizId(String bizId);

}
